package cn.edu.hqu.cst.chapter0204.domain;

import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

@Data
public class Taco {
    @NotNull
    @Size(
            min = 3,
            message = "必须输入您的三位学号"
    )
    private String name;
    @Size(
            min = 1,
            message = "You must choose at least 1 ingredient"
    )
    private List<String> ingredients;

    public String getName() {
        return this.name;
    }

    public List<String> getIngredients() {
        return this.ingredients;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setIngredients(List<String> ingredients) {
        this.ingredients = ingredients;
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof Taco)) {
            return false;
        } else {
            Taco other = (Taco) o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$name = this.getName();
                Object other$name = other.getName();
                if (this$name == null) {
                    if (other$name != null) {
                        return false;
                    }
                } else if (!this$name.equals(other$name)) {
                    return false;
                }

                Object this$ingredients = this.getIngredients();
                Object other$ingredients = other.getIngredients();
                if (this$ingredients == null) {
                    if (other$ingredients != null) {
                        return false;
                    }
                } else if (!this$ingredients.equals(other$ingredients)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof Taco;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = 1;
        Object $name = this.getName();
        result = result * 59 + ($name == null ? 43 : $name.hashCode());
        Object $ingredients = this.getIngredients();
        result = result * 59 + ($ingredients == null ? 43 : $ingredients.hashCode());
        return result;
    }

    public String toString() {
        return "Taco(name=" + this.getName() + ", ingredients=" + this.getIngredients() + ")";
    }

    public Taco() {
    }
}
